﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PoisonControl : MonoBehaviour
{
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.layer == LayerMask.NameToLayer("Player"))
        {
            Debug.Log("毒素");
            Actor target = other.gameObject.GetComponent<Actor>();
            if (target.networkId.Equals(Game.GetComp<ActorManager>().controlPlayerId))
            {
                target.propertyComponent.CmdTakeDamage(target.networkId, -5);
            }
        }
    }
}
